package com.oolee.cloud.general;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class GeneralResult<T> {

    private Integer code;

    private String  msg;

    private T       data;

    public GeneralResult(Integer code, String msg){
        this(code,msg,null);
    }


    public static GeneralResult success(){
        return new GeneralResult(ResponseType.SUCCESS.getCode(),ResponseType.SUCCESS.getMsg());
    }

    public static GeneralResult fail(){
        return new GeneralResult(ResponseType.FAIL.getCode(),ResponseType.FAIL.getMsg());
    }




}